<template>
  <div>
    <div style="position: fixed;top: 0;left: 0;width: 100%;height:100%;background-color:#898e9b"></div>
    <div style="position: absolute;top: 0;left: 0;width: 100%;height:120px;background-color:#647aad">
      <p style="font-size: 100px;font-weight:800;color:#4dbdff;text-align: center;font-style: italic;font-family:楷体">简历box</p>
      <el-button type="info" plain round style="position: fixed;top: 80px;left: 61%" @click="$router.push('/home-page')">返回主页</el-button>
    </div>
    <div style="position: absolute;top: 120px;left:0;">
      <el-table :data="userresumetable" style="width: 1705px">
        <el-table-column label="公司名称" prop="firmname"/>
        <el-table-column label="姓名" prop="applicant" />
        <el-table-column label="offer" prop="offer" >
          <template v-slot="scope">
            <el-image
                style="width: 100px; height: 100px"
                :src="scope.row.offer ||'https://tse2-mm.cn.bing.net/th/id/OIP-C.gWM_1gkC-L6GaHZ7yFA3qAAAAA?w=231&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7' ||defaultImage"
                :fit="'contain'"
                @error="handleImageError(scope.row)"/>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="left" width="400px">
          <template #default="scope">
            <a :href="scope.row.offer">下载offer</a>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<style>

</style>
<script>
import axios from "axios";
import {UploadFilled} from "@element-plus/icons-vue";
import request from "@/Utils/request.js";
export default {
  components: {UploadFilled},
  data(){
    return{
      defaultImage:'https://gd-hbimg.huaban.com/8a599a1eef41dcdbfdfa9194596e8220fa9569d227b89-L623jo_fw658',
      filelist:[],
      name:'',
      offer:'',
      userresumetable:[],
      user:localStorage.getItem("user")?JSON.parse(localStorage.getItem("user")):{},
      usermsg:localStorage.getItem("usermsg")?JSON.parse(localStorage.getItem("usermsg")):{},
    }
  }
  ,
  methods:{
    handleImageError(row){
      row.offer=this.defaultImage
    }
  },
  mounted() {
    request.get('/userresume/selectoffer',{
      params:{
        account: this.user.account
      }
    }).then(res=>{
      this.userresumetable=res
      console.log(res)
      // this.fileList[0]['response']=res.data[0]['offer']
    })
  }
}
</script>